import { requestClient } from '#/api/request';

/**
 * 获取用户分页列表
 */
export const getUserPage = async (params: any) => {
  return requestClient.post('/api/sysUser/page', params);
};

/**
 * 创建用户
 */
export const addUser = async (params: any) => {
  return requestClient.post('/api/sysUser/add', params);
};

/**
 * 更新用户
 */
export const updateUser = async (params: any) => {
  return requestClient.post('/api/sysUser/update', params);
};

/**
 * 更新用户状态
 */
export const updateUserStatus = async (params: any) => {
  return requestClient.post('/api/sysUser/updateUserStatus', params);
};

/**
 * 删除用户
 */
export const deleteUser = async (params: any) => {
  return requestClient.post('/api/sysUser/delete', params);
};

/**
 * 获取用户扩展机构集合
 */
export const getOwnExtOrgList = async (userId: number) => {
  return requestClient.get(`/api/sysUser/ownExtOrgList/${userId}`);
};

/**
 * 获取用户拥有角色集合
 */
export const getOwnRoleList = async (userId: number) => {
  return requestClient.get(`/api/sysUser/ownRoleList/${userId}`);
};
